<div class="container part-recommend">

    <div class="row">
        <h2><a href="javascript:;">投影仪推荐</a></h2>
    </div>

    <div class="row">
    <?php

$cats = get_categories(array(
    'child_of' => 1,
    'parent' => '30',
    'hide_empty' => 0
    ));
    $catoid_group='';
    foreach ($cats as $key => $value) {
        $catoid_group.=$value->term_id.',';
        $catoid_group1[]=$value->term_id;
    }
// var_dump($catoid_group);
    $args=array(
        'cat' => 30,   // 分类ID
        'posts_per_page' => 6, // 显示篇数
        'orderby'=>'date',
        'post__in' => get_option('sticky_posts'), // 显示置顶文章
    'order' => 'DESC'
        // 'category__in'=>array($catoid_group)
    );
    query_posts($args);
    if(have_posts()) : while (have_posts()) : the_post();
    // mb_strimwidth($str, 0, 4, '','utf-8')
?>
        <div class="col-lg-4 col-md-3 pruduct-list-padding ">
        
            <a href="<?php the_permalink(); ?>" target="_blank"><img alt="<?php echo get_the_title() ?>" title="<?php echo get_the_title() ?>" class="img-fluid responsive" src="<?php echo  wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full")[0];?>" alt=""></a>
            <p class="product-list-title" style="text-align:center;"><a class="shenglue" alt="<?php echo get_the_title() ?>" title="<?php echo get_the_title() ?>" href="<?php the_permalink(); ?>" target="_blank"><?php echo get_the_title(); ?></a></p>
        </div>
        <?php  endwhile; endif; wp_reset_query(); ?>


    </div>
</div>
<div class="container  part-recommend">
    <div class="row">
        <h2><a href="javascript:;">新品发布</a></h2>
    </div>
    <?php

$args=array(
    'cat' => 131,   // 分类ID
    'posts_per_page' => 6, // 显示篇数
    'orderby'=>'date',
	'order' => 'DESC'
);
query_posts($args);
if(have_posts()) : while (have_posts()) : the_post();



        $post_ids = ($post_querys->posts)[0]->ID; // 文章ID
        // echo get_post( $post_id )->post_content; // 输出文章的内容
        $recommend_date=get_post( $post_ids );
        // var_dump($recommend_date);
    ?>
    <div class="row">
        <div class="col-lg-7 col-md-12">
            <img class="img-fluid responsive" src="<?php echo  wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full")[0];?>" alt="">

        </div>
        <div class="col-lg-5 col-md-12 index-recommend">
           <a href="<?php echo get_permalink($post_ids ); ?>"><?php  echo $recommend_date->post_title;?></a>
            <h5>
                发布时间:
            </h5>
            <p>
            <?php
                 echo the_field('fabushijian',$post_ids);
                ?>
            </p>
            <h5>
                投影仪类型：
            </h5>
            <p>
                <?php
                    $leixing = get_field('leixing',$post_ids );
                    $leixingarr=explode(',',$leixing);

                    foreach ($leixingarr as $key => $value) {
                        echo '<span class="recommend_type">'.$value.'</span>';
                    }
                ?>
            </p>
            <h5>
                投影仪参数：
            </h5>
            <p>
                <?php
                    echo the_field('canshu',$post_ids);
                ?>
            </p>
        </div>
    </div>
    <?php  endwhile; endif; wp_reset_query(); ?>   

</div>


<div class="container part-recommend">
    <div class="row">
        <h2><a href="javascript:;">投影仪真实测评</a></h2>
    </div>

    <div class="row ceping_grid">
    <?php
        $args=array(
            'cat' => 32,   // 分类ID
            'posts_per_page' => 5, // 显示篇数
            'orderby'=>'date',
	'order' => 'DESC'
        );
        query_posts($args);
        $nums=0;
        if(have_posts()) : while (have_posts()) : the_post();
        $nums= $nums+1;
    ?>
        <div class="ceping-list-<?php echo $nums?>">
        
            <a href="<?php the_permalink(); ?>" target="_blank"><img class="" src="<?php echo  wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full")[0];?>" alt=""></a>
            <p class="ceping-list-title jianbian_bg"><a class="shenglue" alt="<?php echo get_the_title() ?>" title="<?php echo get_the_title() ?>" href="<?php the_permalink(); ?>" target="_blank"><?php echo get_the_title(); ?></a></p>


        </div>
        <?php  endwhile; endif; wp_reset_query(); ?>        

    </div>
</div>


<div class="container  part-recommend">
<?php if ( is_active_sidebar( 'index_adds' ) ) : ?>
    <div id="div-id" class="div-widget-area">
    <?php dynamic_sidebar( 'index_adds' ); ?>
    </div>
<?php endif; ?>

</div>







<div class="container part-recommend">
    <div class="row">
        <h2><a href="javascript:;">行业资讯</a></h2>
    </div>

    <div class="row">
    <?php
        $args=array(
            'cat' => 5,   // 分类ID
            'posts_per_page' => 6, // 显示篇数
            'orderby'=>'date',
	'order' => 'DESC'
        );
        query_posts($args);
        if(have_posts()) : while (have_posts()) : the_post();
    ?>
        <div class="col-lg-4 col-md-6 pruduct-list-padding ">
        
            <a href="<?php the_permalink(); ?>" target="_blank"><img class="img-fluid responsive" src="<?php echo  wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full")[0];?>" alt=""></a>
            <p class="product-list-title"><a class="shenglue" alt="<?php echo get_the_title() ?>" title="<?php echo get_the_title() ?>" href="<?php the_permalink(); ?>" target="_blank"><?php echo get_the_title(); ?></a></p>
            <p class="product-list-des">
            <?php if (has_excerpt()) {
                echo $description = trim(get_the_excerpt()); //文章编辑中的摘要
            }else {
                $article_des=mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 170,"……");
                $str = mb_ereg_replace('^(　| )+', '', $article_des);
                $str = mb_ereg_replace('(　| )+$', '', $str);
                echo $str ; //文章编辑中若无摘要，自定截取文章内容字数做为摘要
            } ?></p>
            <p class="product-list-date"><?php the_time('Y-m-d');   ?></p>
        </div>
        <?php  endwhile; endif; wp_reset_query(); ?>        

    </div>
</div>

<div class="container part-recommend baikepart-recommend">
    <div class="row">
        <h2><a href="javascript:;">投影百科</a></h2>
    </div>

    <div class="row">
        <div class="col-lg-4 col-md-4 baike_left">
            


            <?php
                    $args=array(
                        'cat' => 65,   // 分类ID
                        'posts_per_page' => 1, // 显示篇数
                        'orderby'=>'date',
	'order' => 'DESC'
                    );
                    
                    query_posts($args);

                    if(have_posts()) : while (have_posts()) : the_post();
                    $baike_first_id=get_the_id();

                ?>
                <a class="shenglue <?php echo is_sticky($ID)?'sticky':'' ?>" alt="<?php echo get_the_title() ?>" title="<?php echo get_the_title() ?>" href="<?php the_permalink(); ?>" target="_blank">
                <img class="img-fluid responsive" src="<?php echo  wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full")[0];?>" alt="">
                
                <p class="jianbian_bg"><?php echo get_the_title(); ?></p>
            </a>
                <?php  
                endwhile; endif; 
                wp_reset_query(); 
                ?> 
        </div>
        <div class="col-lg-4 col-md-4 ">
            <ul>
                <?php

                    $args=array(
                        'cat' => 65,   // 分类ID
                        'posts_per_page' => 7, // 显示篇数
                        'post__not_in'=>array($baike_first_id),
                        'orderby'=>'date',
	'order' => 'DESC'
                    );
                    query_posts($args);
                    $i=0;
                    if(have_posts()) : while (have_posts()) : the_post();
                ?>
                <li><a class="shenglue <?php echo is_sticky($ID)?'sticky':'' ?>" alt="<?php echo get_the_title() ?>" title="<?php echo get_the_title() ?>" href="<?php the_permalink(); ?>" target="_blank"><?php echo get_the_title(); ?></a></li>
                <?php  
                endwhile; endif; 
                wp_reset_query(); 
                ?>   
            </ul>
        </div>
        <div class="col-lg-4 col-md-4 ">
        
        <?php if ( is_active_sidebar( 'index_adds_baike' ) ) : ?>
            <div  class="div-widget-area">
            <?php dynamic_sidebar( 'index_adds_baike' ); ?>
            </div>
        <?php endif; ?>
        </div>




    </div>
</div>

<div class="container part-recommend">
    <div class="row">
        <h2><a href="javascript:;">投影问答</a></h2>
    </div>

    <div class="row">
    <?php
        $args=array(
            'cat' => 91,   // 分类ID
            'posts_per_page' => 6, // 显示篇数
        );
        query_posts($args);
        if(have_posts()) : while (have_posts()) : the_post();
    ?>
        <div class="col-lg-6 col-md-6 wenda-padding ">
            <div class="wenda-title"><a  href="<?php the_permalink(); ?>" target="_blank"><h5><?php echo  mb_strimwidth(get_the_title(),0,60, '','utf-8'); ?></h5></a></div>
            <div class="wenda-desc">
            <?php if (has_excerpt()) {
                echo $description = trim(get_the_excerpt()); //文章编辑中的摘要
            }else {
                $article_des=mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 200,"……");
                $str = mb_ereg_replace('^(　| )+', '', $article_des);
                $str = mb_ereg_replace('(　| )+$', '', $str);
                echo $str ; //文章编辑中若无摘要，自定截取文章内容字数做为摘要
            } ?>
            </div>
        </div>
        <?php  endwhile; endif; wp_reset_query(); ?>  
        


    </div>
</div>